-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Java 19 build #2478
Fix Java 19 build #2478
Conversation
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
So the mockito issue in time series api unit tests won't be solved as it is not recommended to mock JDK classes. |
It looks like jacoco is not working too. Maybe need to be updated? |
Confirmed. We need to update powsybl-parent to jacoco 0.8.8 |
We get an exception: org.mockito.exceptions.base.MockitoException: Mockito cannot mock this class: class java.nio.ByteBuffer. Try to use java.nio APIs to use no resources (sparse, private), not sure how this works on all platforms.. Signed-off-by: HARPER Jon <jon.harper87@gmail.com>
e4cde80
to
dd5485c
Compare
for (FileChannel channel : channels) { | ||
channel.close(); | ||
} | ||
Files.delete(tempdir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonenst On Windows test failed because directory is not empty. So a real file has been created on the file system even in private map mode.
@jonenst thinking again not sure this is the right testing strategy. I tested on a 4Go Windows virtual machine and all tests failed with Caused by: java.io.IOException: Le fichier de pagination est insuffisant pour terminer cette opération
at java.base/sun.nio.ch.FileChannelImpl.map0(Native Method)
at java.base/sun.nio.ch.FileChannelImpl.mapInternal(FileChannelImpl.java:1305)
at java.base/sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:1181)
at com.powsybl.timeseries.AbstractBigBufferTest.testAllocator(AbstractBigBufferTest.java:39) We should not require so much memory for running unit test and not really allocate so big buffers. |
…ility without bytebuffer Signed-off-by: HARPER Jon <jon.harper87@gmail.com>
4414c9b
to
e63d9e6
Compare
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Kudos, SonarCloud Quality Gate passed! |
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restNo
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix
What is the current behavior? (You can also link to an open issue here)
We cannot build using a JDK 19
What is the new behavior (if this is a feature change)?
Mockito core and Groovy need to be updated bu there is still an issue with Mockito when mocking java.util.ByeBuffer.
Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)